function* oneDigitPrimes() {
  yield 2;
  yield 3;
  yield 5;
  yield 7;
}
function* zip(...iterable) {
  let iterators = iterable.map((e) => e[Symbol.iterator]());
  while (iterators.length) {
    const toRemove = [];
    for (const iterator of iterators) {
      const t = iterator.next();
      if (!t.done) yield t.value;
      else toRemove.push(iterator);
    }
    iterators = iterators.filter((i) => !toRemove.includes(i));
  }
}

console.log([...zip(oneDigitPrimes(), "ab", [0])].toString()); // 2,a,0,3,b,5,7
